/**********************************************************
*
*   @file    useri2cReg.h
*   @author  Derrick Wang
*   @time    2018-4-26
*		@brief   定义I2c寄存器相关信息
*
*
***********************************************************/

#ifndef __USER_I2C_REG_H
#define __USER_I2C_REG_H

#define I2C_FIXED_ADDRESS      0X04   //模块固定地址
#define VERSION                0X10//版本号
//模块总寄存器数量
#define ALL_REG_NUMBER  44

//模块通用寄存器
#define REG_CHECK               0X0A 
#define REG_VERSION             0X0B
#define REG_LED                 0X0C
#define REG_RESET               0X0D
 
//模块特殊指令
#define REG_SOFT_VER                0X30        
#define REG_DRAW                    0X31
#define REG_MENU                    0X32
#define REG_GAME1                   0X33
#define REG_SAVER                   0X34
#define REG_POPUP                   0X35
#define REG_GAME2                   0X36
#define REG_GAME3                   0X37


#define REG_UP                      0X50
#define REG_DOWN                    0X51
#define REG_LEFT                    0X52
#define REG_RIGHT                   0X53
#define REG_NUMBER                  0X54
#define REG_START                   0X55
#define REG_RETURN                  0X56
#define REG_MENU_ADD_ITEM           0X40
#define REG_MENU_NOW_ITEM           0X41
#define REG_MENU_CLEAR_ITEM         0X42

#define REG_LINE                    0X60
#define REG_VLINE                   0X61
#define REG_HLINE                   0X62
#define REG_RECT                    0X63
#define REG_FILL_RECT               0x64
#define REG_FILL_SCREEN             0X65
#define REG_CIRCLE                  0X66
#define REG_PART_CIRCLE             0X67
#define REG_FILL_CIRCLE             0X68
#define REG_FILL_PART_CIRCLE        0X69
#define REG_TRIANGLE                0X6A
#define REG_FILL_TRIANGLE           0X6B
#define REG_ROUND_RECT              0X6C
#define REG_FILL_ROUND_RECT         0X6D
#define REG_BITMAP                  0X6E
#define REG_PRINT                   0X6F
#define REG_PRINTLN                 0X70
#define REG_DRAW_CHAR               0X71
#define REG_SET_CURSOR              0X72
#define REG_DRAW_PIXEL              0X73
#define REG_CLEAR_SCREEN            0X74

#define REG_BACKLIGHT               0X80



//I2C命令（lcd5110专用）
#define CMD_NONE           0X00
#define CMD_UP             REG_UP
#define CMD_DOWN           REG_DOWN
#define CMD_LEFT           REG_LEFT
#define CMD_RIGHT          REG_RIGHT
#define CMD_NUMBER         REG_NUMBER
#define CMD_START          REG_START
#define CMD_RETURN         REG_RETURN 

uint8_t user_i2cGetCmd(void);
#define CACHE_SIZE  20
extern uint8_t cache[CACHE_SIZE];

#endif
